﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Collections.ObjectModel;
using GA.Shared.Interfaces;
using System.Runtime.Serialization;
using System.Windows.Data;
using GA.Server.DatabaseManager;
using GA.Shared.Objects;

namespace GA.Server.Objects
{
    public class DatabaseGameClassType : DatabaseObject
    {
        /// <summary>
        /// Identifies the Id Property.
        /// </summary>
        public static readonly DependencyProperty IdProperty =
            DependencyProperty.Register(
                "Id",
                typeof(int),
                typeof(DatabaseGameClassType),
                new PropertyMetadata(-1));

        /// <summary>
        /// Identifies the GameId Property.
        /// </summary>
        public static readonly DependencyProperty GameIdProperty =
            DependencyProperty.Register(
                "GameId",
                typeof(int),
                typeof(DatabaseGameClassType),
                new PropertyMetadata(-1));

        /// <summary>
        /// Identifies the Name Property.
        /// </summary>
        public static readonly DependencyProperty NameProperty =
            DependencyProperty.Register(
                "Name",
                typeof(string),
                typeof(DatabaseGameClassType),
                new PropertyMetadata(string.Empty));

        /// <summary>
        /// Identifies the ShortName Property.
        /// </summary>
        public static readonly DependencyProperty ShortNameProperty =
            DependencyProperty.Register(
                "ShortName",
                typeof(string),
                typeof(DatabaseGameClassType),
                new PropertyMetadata(string.Empty));

        /// <summary>
        /// Identifies the Levels Property.
        /// </summary>
        public static readonly DependencyProperty LevelsProperty =
            DependencyProperty.Register(
                "Levels",
                typeof(ObservableCollection<GameClassLevel>),
                typeof(DatabaseGameClassType),
                new PropertyMetadata(null));

        /// <summary>
        /// Gets or sets the Id.
        /// </summary>
        
        [DatabaseField("Id", IsIdentity = true, IsKey = true)]
        public int Id
        {
            get { return (int)SafeGetValue(IdProperty); }
            set { SafeSetValue(IdProperty, value); }
        }

        /// <summary>
        /// Gets or sets the GameId.
        /// </summary>
        
        [DatabaseField("GameId", IsKey = true)]
        public int GameId
        {
            get { return (int)SafeGetValue(GameIdProperty); }
            set { SafeSetValue(GameIdProperty, value); }
        }

        /// <summary>
        /// Gets or sets the Name.
        /// </summary>
        
        [DatabaseField("Name", IsKey = true, IsQuoted = true)]
        public string Name
        {
            get { return (string)SafeGetValue(NameProperty); }
            set { SafeSetValue(NameProperty, value); }
        }

        /// <summary>
        /// Gets or sets the ShortName.
        /// </summary>
        
        [DatabaseField("ShortName", IsQuoted = true)]
        public string ShortName
        {
            get { return (string)SafeGetValue(ShortNameProperty); }
            set { SafeSetValue(ShortNameProperty, value); }
        }

        /// <summary>
        /// Gets or sets the Levels.
        /// </summary>
        
        public ObservableCollection<GameClassLevel> Levels
        {
            get { return (ObservableCollection<GameClassLevel>)SafeGetValue(LevelsProperty); }
            set { SafeSetValue(LevelsProperty, value); }
        }

        public DatabaseGameClassType()
        {
        }

        public DatabaseGameClassType(LinkedDependencyObject baseObject)
            : base(baseObject)
        {
        }

        public DatabaseGameClassType(LinkedDependencyObject baseObject, BindingMode bindingMode)
            : base(baseObject, bindingMode)
        {
        }

        public override void LoadAllPropertyObjects()
        {
            #warning Not Implemented
        }

        public override void LoadPropertyObject(string propertyName)
        {
            #warning Not Implemented
        }
    }
}
